<% include public/header.html %>
<link href="common/userCenter.css" rel="stylesheet"/>
<link href="stylesheets/orders/orders.css" rel="stylesheet"/>
<div id="container">
    <%- view %>
</div>
<script type="text/javascript" src="lib/Formsy.js"></script>
<script type="text/javascript">
Formsy.addValidationRule('maxValue', (values, value, max) => {
    value = parseInt(value);
    if (typeof value !== 'number') {
        return false;
    }
    if(!max) max = 100000;
    if(value <= max) return true;
    else return false;
});
Formsy.addValidationRule('minValue', (values, value, min) => {
    value = parseInt(value);
    if (typeof value !== 'number') {
        return false;
    }
    if(!min) min = 1;
    if(value >= min) return true;
    else return false;
});
Formsy.addValidationRule('eqZero', (values, value, min) => {
    value = parseFloat(value);
    if (typeof value !== 'number') {
        return false;
    }
    if(value > 0) return true;
    else return false;
});
Formsy.addValidationRule('isLimitFloat', (values, value, min) => {
    if(value == 0 || value == '0'){
        return false;
    }
    return /^(?:[-+]?(?:\d+))?(?:\.\d{1,3})?$/.test(value);
});
Formsy.addValidationRule('isName', (values, value, min) => {
    return /^([\w\u4E00-\u9FA5_\-]+)+$/.test(value);
});
Formsy.addValidationRule('isEnName', (values, value, min) => {
    return /^([\w_\-]+)+$/.test(value);
});
Formsy.addValidationRule('isPhone', (values, value, min) => {
    return /^([0-9_\-+]+)+$/.test(value);
});
Formsy.addValidationRule('checkWeight', (values, value, min) => {
    return min;
});
Formsy.addValidationRule('isInteger', (values, value, min) => {
    return /^[1-9]\d*$/.test(value);
});
</script>
<script>
    use(["public/javascripts/orders/init.js"]);
</script>
<% include public/footer.html %>